package two_shang._11_23;

public class VirtualHospital {
    public static void main(String[] args) throws InterruptedException {
        TeShuBingRen teShuBingRen = new TeShuBingRen();
        teShuBingRen.setPriority(8);
        Thread.currentThread().setPriority(5);
        teShuBingRen.start();
        for (int i = 0; i < 50; i++) {
            Thread.sleep(200);
            System.out.println("普通号" + i);
            if (i == 10) {
                teShuBingRen.join();
            }
        }
    }
}

class TeShuBingRen extends Thread {
    private int temp = 0;

    @Override
    public void run() {
        for (; temp < 10; temp++) {
            try {
                Thread.sleep(400);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("特需号" + temp);
        }
    }
}
